package com.ruoyi.accounts.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.accounts.domain.EmpProperty;
import com.ruoyi.accounts.domain.vo.EmpPropertyVo;
import com.ruoyi.common.core.domain.machine.EmpMachine;
import com.ruoyi.store.domain.EmpRmbExchange;
import com.ruoyi.store.domain.EmpTicketExchange;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository
public interface EmpPropertyMapper extends BaseMapper<EmpProperty> {
    EmpPropertyVo selectEmpPropertyByCustomIDAndStoreID(@Param("customID") String customID, @Param("storeID") Long storeID);

    void insertEmpProperty(EmpPropertyVo empProperty);

    void updateGameCurrency(EmpPropertyVo empProperty);

    int updateEmpProperty(EmpProperty empProperty);
    
    EmpTicketExchange selectTicketExchangeByStoreID(@Param("storeID") Long storeID);

    EmpRmbExchange selectRmbExchangeByRmbExchangeID(@Param("rmbExchangeID") String rmbExchangeID);

    void addRechargeLogs(@Param("customID") Long customID, @Param("rechargeAmount") Integer rechargeAmount);
    
    //EmpProperty getEmpPropertyBySotre(EmpProperty empProperty);

    @Select("SELECT m.* FROM emp_machine m LEFT JOIN emp_equipment eq on m.EquipmentID = eq.EquipmentID where eq.HardwareNumber = #{equipmentID}  LIMIT 1")
    EmpMachine getByEquipmentID(String equipmentID);

    @Select("SELECT * FROM emp_property where CustomID = #{customID}  LIMIT 1")
    EmpProperty selectByCustomID(@Param("customID") String customID);
}
